package com.j4dream.property.javabasic.designpattern.factory_abstract;

import com.j4dream.property.javabasic.designpattern.factory.Circle;
import com.j4dream.property.javabasic.designpattern.factory.Rectangle;
import com.j4dream.property.javabasic.designpattern.factory.Shape;
import com.j4dream.property.javabasic.designpattern.factory.Square;

public class ShapeFactory extends AbstractFactory {
    @Override
    public Color getColor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String type) {
        if ("circle".equalsIgnoreCase(type)) {
            return new Circle();
        } else if ("rectangle".equalsIgnoreCase(type)) {
            return new Rectangle();
        } else if ("Square".equalsIgnoreCase(type)){
            return new Square();
        }
        return null;
    }
}
